﻿<%@ Page Title="" Language="C#" MasterPageFile="~/webmx/layout/Default.master" AutoEventWireup="true" CodeFile="List.aspx.cs" Inherits="webmx_program_product_List" %>

<%@ Import Namespace="System.Data" %>
<asp:Content ID="Content1" ContentPlaceHolderID="mp_head" runat="Server">
    <link rel="stylesheet" href="/webmx/css/select2.css" />
    <style>
        .select2-container { margin-top: 4px; }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="mp_body" runat="Server">
    <div class="container-fluid">
        <div class="row-fluid">
            <div class="span12">
                <div class="widget-box">
                    <div class="widget-title">
                        <span class="icon"><i class="icon-th"></i></span>
                        <h5>法务信息列表</h5>
                        <div style="float: left; padding: 0 20px; height: 36px; line-height: 33px;">
                            <a href="add.aspx" class="btn btn-success btn-mini">添加法务</a>
                        </div>
                    </div>
                    <div class="widget-content nopadding">
                        <table id="odata" class="table table-bordered data-table">
                            <thead>
                                <tr>
                                    <th>#</th>
                                    <th>年份</th>
                                    <th>法务名称</th>
                                    <th>开始时间</th>
                                    <th>结束时间</th>
                                    <th>排列顺序</th>
                                    <th style="width: 120px;">操作</th>
                                </tr>
                            </thead>
                            <tbody>
                                <%
                                    if (data != null && data.Count > 0)
                                    {
                                        for (int i = 0; i < data.Count; i++)
                                        {
                                %>
                                <tr class="gradeX">
                                    <td><%=(i+1) %></td>
                                    <td><%=data[i].Year %></td>
                                    <td><%=data[i].Name %></td>
                                    <td><%=data[i].StartTime.ToString("yyyy-MM-dd") %></td>
                                    <td><%=data[i].EndTime.ToString("yyyy-MM-dd") %></td>
                                    <td><%=data[i].SortID %></td>
                                    <td>
                                        <a href="set.aspx?id=<%=data[i].ID %>">编辑</a>
                                        <a href="info/list.aspx?pid=<%=data[i].ID %>">查看登记</a>
                                        <a class="btn_del" href="javascript:;" data-id="<%=data[i].ID %>">删除</a>
                                    </td>
                                </tr>
                                <%
                                        }
                                    }
                                %>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="mp_foot" runat="Server">
    <script type="text/javascript" src="/webmx/js/jquery.uniform.js"></script>
    <script type="text/javascript" src="/webmx/js/select2.min.js"></script>
    <script type="text/javascript" src="/webmx/js/jquery.dataTables.min.js" charset="gb2312"></script>
    <script type="text/javascript" src="/webmx/js/matrix.tables.js"></script>
    <script>
        $(function () {
            $("#sidebar ul li").removeClass("active").eq(1).addClass("active");
            if (getQueryString("lang") != null) $("#sellang").select2("val", getQueryString("lang"));


            $(".btn_del").click(function () {
                var row = $(this).parent().parent();
                $.get("del.ashx", "id=" + $(this).attr("data-id") + "&temp=" + new Date().getTime(), function (data) {
                    if (data) {
                        var table = $("#odata").dataTable();
                        row.remove();
                        alert("操作成功");
                    }
                    else alert("操作失败");
                });
            });

            $('.data-table').on('draw.dt', function () {
                
            });


            function getQueryString(name) {
                var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
                var r = window.location.search.substr(1).match(reg);
                if (r != null) return unescape(r[2]); return null;
            }
        });
    </script>
</asp:Content>

